package observerPattern;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

//新闻频道：具体观察者
@Data
@AllArgsConstructor
@NoArgsConstructor
public class NewChannel implements Observer {

    public String channelName;
    public String news;

    public NewChannel(String channelName) {
        this.channelName = channelName;
    }


    public void update(String news) {
        this.news = news;
        System.out.println("新闻频道：" + channelName + "---发布新闻：" + news);

    }
}
